using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WorkFlowCore.BusinessDemo.Web.Entities
{
    public class OfficialSealApplication
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required(ErrorMessage = "申请人姓名不能为空")]
        [MaxLength(100)]
        public string ApplicantName { get; set; }

        [Required(ErrorMessage = "申请部门不能为空")]
        [MaxLength(200)]
        public string ApplicantDepartment { get; set; }

        [Required(ErrorMessage = "申请日期不能为空")]
        public DateTime ApplicationDate { get; set; } = DateTime.Now;

        [Required(ErrorMessage = "公章类型不能为空")]
        [MaxLength(100)]
        public string SealType { get; set; }

        [Required(ErrorMessage = "申请事由不能为空")]
        [MaxLength(2000)]
        public string Reason { get; set; }

        [Required(ErrorMessage = "预计用章开始日期不能为空")]
        public DateTime UsageStartDate { get; set; }

        [Required(ErrorMessage = "预计用章结束日期不能为空")]
        public DateTime UsageEndDate { get; set; }

        [Required(ErrorMessage = "数量/次数不能为空")]
        [Range(1, int.MaxValue, ErrorMessage = "数量/次数必须大于0")]
        public int Quantity { get; set; } = 1;

        [MaxLength(1000)]
        public string? AttachedFilesInfo { get; set; }

        [MaxLength(50)]
        public string? WorkTaskId { get; set; }

        public DateTime CreatedTime { get; set; } = DateTime.Now;

        public DateTime? UpdatedTime { get; set; }

        [MaxLength(50)]
        public string? CreatorUserId { get; set; }
    }
}
